﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Simple.Repository.Migrations
{
    public partial class _4 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "AreaValue",
                table: "GardenHouseInfo",
                type: "longtext",
                nullable: false,
                comment: "区县值",
                oldClrType: typeof(string),
                oldType: "longtext")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysClasses",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "主键", collation: "ascii_general_ci"),
                    GardenId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "所属园区Id", collation: "ascii_general_ci"),
                    GardenName = table.Column<string>(type: "longtext", nullable: true, comment: "所属园区")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "班级名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    OpenTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "开班时间"),
                    TeacherIds = table.Column<string>(type: "longtext", nullable: true, comment: "教师Id\r\n            多个用逗号隔开")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ClassroomId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "教室Id", collation: "ascii_general_ci"),
                    ClassroomName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "教室名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    NurseIds = table.Column<string>(type: "longtext", nullable: true, comment: "保育员ids\r\n            多个用英文逗号隔开")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsArchived = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否归档"),
                    ArchiveTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "归档时间"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "软删标记"),
                    CreatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "创建时间"),
                    CreatedUserId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "创建用户Id", collation: "ascii_general_ci"),
                    UpdatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "更新时间"),
                    UpdatedUserId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "更新用户Id", collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysClasses", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysFileInfo",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "主键", collation: "ascii_general_ci"),
                    FolderId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "文件夹Id", collation: "ascii_general_ci"),
                    IsFolder = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否文件夹"),
                    FileName = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false, comment: "文件名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    FileSize = table.Column<double>(type: "double", nullable: true, comment: "文件大小（kb）"),
                    Filesuffix = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "文件后缀")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    FilePath = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false, comment: "存储路径")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Remark = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false, comment: "备注")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "软删标记"),
                    CreatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "创建时间"),
                    CreatedUserId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "创建用户Id", collation: "ascii_general_ci"),
                    UpdatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "更新时间"),
                    UpdatedUserId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "更新用户Id", collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysFileInfo", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SysClasses");

            migrationBuilder.DropTable(
                name: "SysFileInfo");

            migrationBuilder.AlterColumn<string>(
                name: "AreaValue",
                table: "GardenHouseInfo",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "区县值")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
